package com.fmy.jurisdiction.modular.service.impl;

import com.fmy.jurisdiction.core.commons.kits.MybatisPlusKit;
import com.fmy.jurisdiction.modular.model.AdminRolePerm;
import com.fmy.jurisdiction.modular.mapper.AdminRolePermMapper;
import com.fmy.jurisdiction.modular.service.IAdminRolePermService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 角色权限表  服务实现类
 * </p>
 *
 * @author Mr.fmy
 * @since 2019-09-16
 */
@Service
public class AdminRolePermServiceImpl extends ServiceImpl<AdminRolePermMapper, AdminRolePerm> implements IAdminRolePermService {

    @Override
    public Integer findByRolePermId(Integer roleId, Integer permId) {
        return this.count(MybatisPlusKit.<AdminRolePerm>q().eq(AdminRolePerm.ROLE_ID, roleId).eq(AdminRolePerm.PERMISSION_ID, permId));
    }
}
